package com.zz.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.zz.service.ExcelService;

@Controller
public class UploadController {
	
	@Autowired
	ExcelService excelService;
	
	 //跳转到上传文件的页面
    @RequestMapping("/upload")
    public Object goUpload() {
        //跳转到 templates 目录下的 upload.html
        return "upload.html";
    }
 
    
 
    
    @RequestMapping("/upexcel")
    @ResponseBody
    public String upload(MultipartFile file) throws Exception {
        excelService.getExcel(file);
 
        return "上传成功";
    }

}
